<?php

/*
Constant definition, for security reason.
Each controller file must require this file first, or other models won't be accessible.
*/
define("IN_XK", 1);

//Disabling magic quotes at runtime
if (get_magic_quotes_gpc())
{
	$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
	while (list($key, $val) = each($process))
	{
		foreach ($val as $k => $v)
		{
			unset($process[$key][$k]);
			if (is_array($v))
			{
				$process[$key][stripslashes($k)] = $v;
				$process[] = &$process[$key][stripslashes($k)];
			} else
			{
				$process[$key][stripslashes($k)] = stripslashes($v);
			}
		}
	}
	unset($process);
}

session_start();
$uid = (isset($_SESSION['id']) ? $_SESSION['id'] : 0);
$username = (isset($_SESSION['username']) ? $_SESSION['username'] : "");
$nickname = (isset($_SESSION['nickname']) ? $_SESSION['nickname'] : "");
date_default_timezone_set("Asia/Shanghai");
$timestamp = $_SERVER['REQUEST_TIME'];

@require_once "./include/error.class.php";
@require_once "./include/global.func.php";
@require_once "./include/db.class.php";

$db = new dbstuff;
$tablepre = $db->tablepre;

define("FORMHASH", formhash());

@require_once "./include/xk.func.php";
@require_once "./include/user.func.php";

?>